package com.member.server.enums;

import java.util.Objects;

/**
 * @author gaojx1993
 * @version 1.0
 * @description RecordType
 * @since 2023/7/11 17:04
 */
public enum RecordType {

    pay(1),

    recharge(10),

    refund(20);

    public static RecordType findByCode(int code) {
        for (RecordType value : values()) {
            if (Objects.equals(code, value.getCode())) {
                return value;
            }
        }
        return null;
    }

    RecordType(int code) {
        this.code = code;
    }

    private final int code;

    public int getCode() {
        return code;
    }
}
